<%@page contentType="text/html"%>  
<%@page pageEncoding="UTF-8"%>  

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>  
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>  
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>  
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>  
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Rich-Ciasoft</title>
    </head>
    <body background="_images/fundo.gif">

        <f:view>
            <rich:panelMenu style="width:170px" mode="ajax" 
                            iconExpandedGroup="disc" iconCollapsedGroup="disc" 
                            iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right" 
                            iconCollapsedTopGroup="chevronDown" expandMode="auto">
            <% if (request.isUserInRole("ADMINISTRADOR")) { %>
                <rich:panelMenuGroup label="Cadastros" expanded="true">
                    <rich:panelMenuGroup label="Administrador" expanded="true">
                        <rich:panelMenuItem label="Usuário" onclick="parent.document.getElementById('conteudo').src='faces/Administrador/UsuarioPesq.jsp';"/>
                    </rich:panelMenuGroup>
                    <rich:panelMenuGroup label="Financeiro" expanded="true">
                        <rich:panelMenuItem label="Forma de Pagamento" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Financeiro/FormaPagamentoPesq.jsp';"/>
                        <rich:panelMenuItem label="Tipo Lancamento" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Financeiro/TipoLancamentoPesq.jsp';"/>
                    </rich:panelMenuGroup>
                    <rich:panelMenuGroup label="Operacional" expanded="true">
                        <rich:panelMenuItem label="Fornecedor" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Operacional/FornecedorPesq.jsp';"/>
                        <rich:panelMenuItem label="Marca" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Operacional/MarcaPesq.jsp';"/>
                        <rich:panelMenuItem label="Produto" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Operacional/ProdutoPesq.jsp';"/>
                    </rich:panelMenuGroup>
                </rich:panelMenuGroup>
                <rich:panelMenuGroup label="Operacional" expanded="true">
                    <rich:panelMenuItem label="Compras" onclick="parent.document.getElementById('conteudo').src='faces/Operacional/CompraPesq.jsp';"/>
                    <rich:panelMenuItem label="Vendas" onclick="parent.document.getElementById('conteudo').src='faces/Operacional/VendaPesq.jsp';"/>
                </rich:panelMenuGroup>
                <rich:panelMenuGroup label="Financeiro" expanded="true">
                    <rich:panelMenuItem label="Baixar Receitas" onclick="parent.document.getElementById('conteudo').src='faces/Financeiro/Contas/ReceberPesq.jsp';"/>
                    <rich:panelMenuItem label="Baixar Pagamentos" onclick="parent.document.getElementById('conteudo').src='faces/Financeiro/Contas/PagarPesq.jsp';"/>
                </rich:panelMenuGroup>
                <rich:panelMenuGroup label="Sair" onclick="parent.location.href='faces/Saida.jsp';" iconCollapsed="none" iconExpanded="none">
                </rich:panelMenuGroup>
            <% } %>
            <% if (request.isUserInRole("FINANCEIRO")) { %>
                <rich:panelMenuGroup label="Cadastros" expanded="true">
                    <rich:panelMenuGroup label="Operacional" expanded="true">
                        <rich:panelMenuItem label="Fornecedor" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Operacional/FornecedorPesq.jsp';"/>
                        <rich:panelMenuItem label="Marca" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Operacional/MarcaPesq.jsp';"/>
                        <rich:panelMenuItem label="Produto" onclick="parent.document.getElementById('conteudo').src='faces/Cadastros/Operacional/ProdutoPesq.jsp';"/>
                    </rich:panelMenuGroup>
                </rich:panelMenuGroup>
                <rich:panelMenuGroup label="Operacional" expanded="true">
                    <rich:panelMenuItem label="Compras" onclick="parent.document.getElementById('conteudo').src='faces/Operacional/CompraPesq.jsp';"/>
                    <rich:panelMenuItem label="Vendas" onclick="parent.document.getElementById('conteudo').src='faces/Operacional/VendaPesq.jsp';"/>
                </rich:panelMenuGroup>
                <rich:panelMenuGroup label="Sair" onclick="parent.location.href='faces/Saida.jsp';" iconCollapsed="none" iconExpanded="none">
                </rich:panelMenuGroup>
            <% } %>
            <% if (request.isUserInRole("OPERACIONAL")) { %>
                <rich:panelMenuGroup label="Operacional" expanded="true">
                    <rich:panelMenuItem label="Vendas" onclick="parent.document.getElementById('conteudo').src='faces/Operacional/VendaPesq.jsp';"/>
                </rich:panelMenuGroup>
                <rich:panelMenuGroup label="Sair" onclick="parent.location.href='faces/Saida.jsp';" iconCollapsed="none" iconExpanded="none">
                </rich:panelMenuGroup>
            <% } %>
            </rich:panelMenu>
        </f:view>
    </body>
</html>